.class public Llt/noframe/gpsfarmguide/gui/GpsGui;
.super Ljava/lang/Object;
.source "GpsGui.java"

# interfaces
.implements Llt/noframe/gpsfarmguide/gui/Gui;


# instance fields
.field private actionButtonsBar:Landroid/view/View;

.field private calculationsBar:Landroid/view/View;

.field private ctx:Landroid/content/Context;

.field private rootView:Landroid/widget/FrameLayout;


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 26
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private addCalculationsBar(Landroid/content/Context;Landroid/view/LayoutInflater;Landroid/widget/FrameLayout;)V
    .locals 2

    const v0, 0x7f0c0076

    const/4 v1, 0x0

    .line 105
    invoke-virtual {p2, v0, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    iput-object p2, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->calculationsBar:Landroid/view/View;

    .line 107
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->calculationsBar:Landroid/view/View;

    invoke-virtual {p3, p2}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 108
    invoke-static {}, Llt/noframe/gpsfarmguide/utils/Calculations;->getInstance()Llt/noframe/gpsfarmguide/utils/Calculations;

    move-result-object p2

    invoke-virtual {p2, p1}, Llt/noframe/gpsfarmguide/utils/Calculations;->iniDistance(Landroid/content/Context;)V

    .line 110
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->calculationsBar:Landroid/view/View;

    invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object p1

    check-cast p1, Landroid/widget/FrameLayout$LayoutParams;

    .line 111
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p2

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p3

    invoke-virtual {p2, p3}, Llt/noframe/gpsfarmguide/Data;->getToolbarheight(Landroid/content/Context;)I

    move-result p2

    iput p2, p1, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I

    return-void
.end method

.method private setButtonListeners()V
    .locals 4

    .line 88
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->rootView:Landroid/widget/FrameLayout;

    const v1, 0x7f090226

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    .line 89
    new-instance v1, Llt/noframe/gpsfarmguide/gui/GpsGui$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/gui/GpsGui$1;-><init>(Llt/noframe/gpsfarmguide/gui/GpsGui;)V

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 97
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->rootView:Landroid/widget/FrameLayout;

    const v1, 0x7f090227

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    .line 98
    iget-object v1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->rootView:Landroid/widget/FrameLayout;

    const v2, 0x7f090228

    invoke-virtual {v1, v2}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 100
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v2

    new-instance v3, Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartStopGpsController;

    invoke-direct {v3, v0, v1}, Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartStopGpsController;-><init>(Landroid/widget/ImageView;Landroid/widget/TextView;)V

    invoke-virtual {v2, v3}, Llt/noframe/gpsfarmguide/Data;->setStartStopGpsController(Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartStopGpsController;)V

    .line 101
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getStartStopGpsController()Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartStopGpsController;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartGps;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartGps;-><init>()V

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartStopGpsController;->setState(Llt/noframe/gpsfarmguide/states/start_stop_gps_states/StartStopGps;)V

    return-void
.end method


# virtual methods
.method public clearGui(I)V
    .locals 1

    .line 58
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->ctx:Landroid/content/Context;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->actionButtonsBar:Landroid/view/View;

    invoke-static {p1, v0}, Llt/noframe/gpsfarmguide/utils/Animations;->bottomDown(Landroid/content/Context;Landroid/view/View;)V

    .line 59
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->ctx:Landroid/content/Context;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->calculationsBar:Landroid/view/View;

    invoke-static {p1, v0}, Llt/noframe/gpsfarmguide/utils/Animations;->topUp(Landroid/content/Context;Landroid/view/View;)V

    .line 60
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->rootView:Landroid/widget/FrameLayout;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->actionButtonsBar:Landroid/view/View;

    invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->removeView(Landroid/view/View;)V

    .line 61
    iget-object p1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->rootView:Landroid/widget/FrameLayout;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->calculationsBar:Landroid/view/View;

    invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->removeView(Landroid/view/View;)V

    .line 62
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    sget-object v0, Llt/noframe/gpsfarmguide/MapClick;->freeModeClick:Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/GoogleMap;->setOnMapClickListener(Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;)V

    .line 63
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/GoogleMap;->setOnMyLocationChangeListener(Lcom/google/android/gms/maps/GoogleMap$OnMyLocationChangeListener;)V

    .line 66
    :try_start_0
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getLocationProvider()Llt/noframe/gpsfarmguide/gps/AppLocationProvider;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->startFree()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    .line 70
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :goto_0
    return-void
.end method

.method public clearGuiWithMeasure()V
    .locals 1

    const/4 v0, 0x0

    .line 51
    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/gui/GpsGui;->clearGui(I)V

    .line 52
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 53
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->remove()V

    :cond_0
    return-void
.end method

.method public getType()I
    .locals 1

    const/4 v0, 0x2

    return v0
.end method

.method public onOrientationChanged(Z)V
    .locals 0

    return-void
.end method

.method public setGui(Landroid/content/Context;Landroid/widget/FrameLayout;Llt/noframe/gpsfarmguide/models/MeasuringModel;)V
    .locals 2

    .line 35
    iput-object p1, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->ctx:Landroid/content/Context;

    const-string p3, "layout_inflater"

    .line 36
    invoke-virtual {p1, p3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Landroid/view/LayoutInflater;

    const v0, 0x7f0c0069

    const/4 v1, 0x0

    .line 37
    invoke-virtual {p3, v0, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 38
    iput-object p2, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->rootView:Landroid/widget/FrameLayout;

    .line 39
    iput-object v0, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->actionButtonsBar:Landroid/view/View;

    .line 40
    invoke-virtual {p2, v0}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 41
    invoke-direct {p0}, Llt/noframe/gpsfarmguide/gui/GpsGui;->setButtonListeners()V

    .line 42
    invoke-direct {p0, p1, p3, p2}, Llt/noframe/gpsfarmguide/gui/GpsGui;->addCalculationsBar(Landroid/content/Context;Landroid/view/LayoutInflater;Landroid/widget/FrameLayout;)V

    .line 43
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->actionButtonsBar:Landroid/view/View;

    invoke-static {p1, p2}, Llt/noframe/gpsfarmguide/utils/Animations;->bottomUp(Landroid/content/Context;Landroid/view/View;)V

    .line 44
    iget-object p2, p0, Llt/noframe/gpsfarmguide/gui/GpsGui;->calculationsBar:Landroid/view/View;

    invoke-static {p1, p2}, Llt/noframe/gpsfarmguide/utils/Animations;->topDown(Landroid/content/Context;Landroid/view/View;)V

    .line 45
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getLocationProvider()Llt/noframe/gpsfarmguide/gps/AppLocationProvider;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->startMeasuring()V

    return-void
.end method
